import tui from '../../../common/httpRequest'
Page({
  data: {
    current: 0,
    tabBar: [{
        "pagePath": "/pages/tabbar/index/index",
        "text": "code",
        "iconPath": "/static/images/tabbar/code_gray.png",
        "selectedIconPath": "/static/images/tabbar/code_active.png",
        "num": 1,
        "isDot": false
      },
      {
        "pagePath": "/pages/tabbar/extend/extend",
        "text": "extend",
        "iconPath": "/static/images/tabbar/extend_gray.png",
        "selectedIconPath": "/static/images/tabbar/extend_active.png",
        "num": 2,
        "isDot": true
      },
      {
        "pagePath": "/pages/tabbar/my/my",
        "text": "thor",
        "iconPath": "/static/images/tabbar/thor_gray.png",
        "selectedIconPath": "/static/images/tabbar/thor_active.png",
        "verify": true
      }
    ],
    tabBar2: [{
        "pagePath": "/pages/tabbar/index/index",
        "text": "code",
        "iconPath": "/static/images/tabbar/code_gray.png",
        "selectedIconPath": "/static/images/tabbar/code_active.png"
      },
      {
        "pagePath": "",
        "text": "extend",
        "iconPath": "/static/images/tabbar/release.png",
        "hump": true,
        "selectedIconPath": "/static/images/tabbar/release.png"
      },
      {
        "pagePath": "/pages/tabbar/my/my",
        "text": "thor",
        "iconPath": "/static/images/tabbar/thor_gray.png",
        "selectedIconPath": "/static/images/tabbar/thor_active.png",
        "num": 2,
        "isDot": true,
        "verify": true
      }
    ],
    backgroundColor: 'rgba(248,248,248,.7)'
  },
  tabbarSwitch(e) {
    //获取登录状态，此处默认未登录
    let isLogin = false
    if (e.detail.verify && !isLogin) {
      tui.toast("您还未登录，请先登录")
    } else {
      this.setData({
        current: e.detail.index
      })
    }
  },
  onLoad(){
     if(tui.isAndroid()){
       this.setData({
        backgroundColor:'#f8f8f8'
       })
     }
  }
})